<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/include/inc.jsp"%>
<!DOCTYPE html >
<html>
<head>
<%@ include file="/WEB-INF/view/jQgrid.jsp"%>
</head>
<body style="background-color: white;" class="gray-bg">
	<div class="ibox-content">
		<form class="form-horizontal m-t" id="signupForm" method="post" enctype="multipart/form-data">
		   <input type="hidden" class="form-control" name="id"  value="${talentsWorkExperienceResource.id}"/>
			<div class="form-group">
				<label class="col-sm-3 control-label">公司ID：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="companyId" name="companyId"  value="${talentsWorkExperienceResource.companyId}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">公司名称：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="companyName" name="companyName"  value="${talentsWorkExperienceResource.companyName}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">职位：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="position" name="position"  value="${talentsWorkExperienceResource.position}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">部门ID：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="depId" name="depId"  value="${talentsWorkExperienceResource.depId}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">汇报上级：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="report" name="report"  value="${talentsWorkExperienceResource.report}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">下属人数：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="subordinateNum" name="subordinateNum"  value="${talentsWorkExperienceResource.subordinateNum}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">工作职责：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="responsibility" name="responsibility"  value="${talentsWorkExperienceResource.responsibility}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">工作业绩：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="performance" name="performance"  value="${talentsWorkExperienceResource.performance}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">项目经验：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="project" name="project"  value="${talentsWorkExperienceResource.project}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">[任职]/开始时间：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="startDate" name="startDate"  value="${talentsWorkExperienceResource.startDate}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">[离职]/结束时间：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="endDate" name="endDate"  value="${talentsWorkExperienceResource.endDate}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">简历人：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="talentsId" name="talentsId"  value="${talentsWorkExperienceResource.talentsId}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="remark" name="remark"  value="${talentsWorkExperienceResource.remark}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">工作职能：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="job" name="job"  value="${talentsWorkExperienceResource.job}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">工作地点：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="workplace" name="workplace"  value="${talentsWorkExperienceResource.workplace}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">公司描述：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="description" name="description"  value="${talentsWorkExperienceResource.description}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">项目名称多个：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="projectNames" name="projectNames"  value="${talentsWorkExperienceResource.projectNames}"/>
				</div>
			</div>
			<div class="form-group" style="text-align: center;">
				<div class="col-sm-8 col-sm-offset-3">
					<button class="btn btn-primary" type="button" id="sub">提交</button>
				</div>
			</div>
		</form>
	</div>


	<script>
    $(function () {
	  $("#sub").click(function () {
        	//批量验证表单非空
			//调用方式
        	var arr=new Array(
        	  new Array('companyId','公司ID未填写!'),
        	  new Array('companyName','公司名称未填写!'),
        	  new Array('position','职位未填写!'),
        	  new Array('depId','部门ID未填写!'),
        	  new Array('report','汇报上级未填写!'),
        	  new Array('subordinateNum','下属人数未填写!'),
        	  new Array('responsibility','工作职责未填写!'),
        	  new Array('performance','工作业绩未填写!'),
        	  new Array('project','项目经验未填写!'),
        	  new Array('startDate','[任职]/开始时间未填写!'),
        	  new Array('endDate','[离职]/结束时间未填写!'),
        	  new Array('talentsId','简历人未填写!'),
        	  new Array('remark','备注未填写!'),
        	  new Array('job','工作职能未填写!'),
        	  new Array('workplace','工作地点未填写!'),
        	  new Array('description','公司描述未填写!'),
        	  new Array('projectNames','项目名称多个未填写!'),
        	)
        	  for(var i=0;i<arr.length;i++){
	        	  if($("#"+arr[i][0]).val()==''){
	        		  $("#"+arr[i][0]).tips({
	  					side:3,
	  		            msg:arr[i][1],
	  		            bg:'#AE81FF',
	  		            time:1
	  		        });
	        		  $("#"+arr[i][0]).focus();
	  				return;
	  			}
        	  }
            $("#signupForm").ajaxSubmit({
                url: '<%=contextPath%>/talentsWorkExperienceResource/update',
                type: 'post',
                dataType: "json",
                beforeSend: function () {
			        // 禁用按钮防止重复提交
					$("#sub").attr("disabled","disabled");
					swal("信息已经提交，请等待后台处理~！");
			    },
				success : function(data) {
					if (data.code == 200) {
						swal({
							title : data.message,
							type : "success",
							showCancelButton : false,
							confirmButtonText : "确定",
							animation : "slide-from-bottom",
							text: "2秒后自动关闭。", 
	      	    			timer: 2000, 
							closeOnConfirm : true
						}, function() {
							top.Dialog.close();
						});
					} else {
						swal("错误", data.message, "error");
					}  
				},    
				complete: function () {
			        $("#sub").removeAttr("disabled");
			    },
			    error: function (data) {
			    	swal("错误", data.message, "error");
			    }
        });
    });
  });  
</script>
</body>
</html>